package com.kgdev.cweb.entities.pub;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import com.kgdev.cweb.entities.ManagedEntity;

/**
 * The persistent class for the pub_order_quantity database table.
 * 
 */
@Entity
@NamedQueries(value = { @NamedQuery(name = "OrderQuantity.findAll", query = "select o from OrderQuantity o") })
@Table(name = "pub_order_quantity")
public class OrderQuantity implements Serializable, ManagedEntity {
	private static final long serialVersionUID = 1L;

	@Id
	@TableGenerator(name = "PUB_ORD_QNT", allocationSize = 1, initialValue = 1, table = "SEQUENCE", valueColumnName = "SEQ_COUNT", pkColumnName = "SEQ_NAME", pkColumnValue = "PUB_ORD_QNT")
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "PUB_ORD_QNT")
	@Column(name = "quantity_id", unique = true, nullable = false)
	private Integer quantityId;

	@Column(nullable = false)
	private Integer quantity;

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((quantity == null) ? 0 : quantity.hashCode());
		return result;
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		OrderQuantity other = (OrderQuantity) obj;
		if (quantity == null) {
			if (other.quantity != null)
				return false;
		} else if (!quantity.equals(other.quantity))
			return false;
		return true;
	}


	public OrderQuantity() {
	}

	public Integer getQuantityId() {
		return this.quantityId;
	}

	public void setQuantityId(Integer quantityId) {
		this.quantityId = quantityId;
	}

	public Integer getQuantity() {
		return this.quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

}